Integrand size = 21, antiderivative size = 64 \[ \int \frac {\cot (e+f x)}{a+b \tan ^2(e+f x)} \, dx=\frac {\log (\cos (e+f x))}{(a-b) f}+\frac {\log (\tan (e+f x))}{a f}+\frac {b \log \left (a+b \tan ^2(e+f x)\right )}{2 a (a-b) f} \]
Time = 0.06 (sec) , antiderivative size = 59, normalized size of antiderivative = 0.92 \[ \int \frac {\cot (e+f x)}{a+b \tan ^2(e+f x)} \, dx=\frac {\frac {\log (\cos (e+f x))}{a-b}+\frac {\log (\tan (e+f x))}{a}+\frac {b \log \left (a+b \tan ^2(e+f x)\right )}{2 a (a-b)}}{f} \]
(Log[Cos[e + f*x]]/(a - b) + Log[Tan[e + f*x]]/a + (b*Log[a + b*Tan[e + f* x]^2])/(2*a*(a - b)))/f
Time = 0.28 (sec) , antiderivative size = 66, normalized size of antiderivative = 1.03, number of steps used = 6, number of rules used = 5, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.238, Rules used = {3042, 4153, 354, 93, 2009}
Below are the steps used by Rubi to obtain the solution. The rule number used for the transformation is given above next to the arrow. The rules definitions used are listed below.
\(\displaystyle \int \frac {\cot (e+f x)}{a+b \tan ^2(e+f x)} \, dx\) |
\(\Big \downarrow \) 3042 |
\(\displaystyle \int \frac {1}{\tan (e+f x) \left (a+b \tan (e+f x)^2\right )}dx\) |
\(\Big \downarrow \) 4153 |
\(\displaystyle \frac {\int \frac {\cot (e+f x)}{\left (\tan ^2(e+f x)+1\right ) \left (b \tan ^2(e+f x)+a\right )}d\tan (e+f x)}{f}\) |
\(\Big \downarrow \) 354 |
\(\displaystyle \frac {\int \frac {\cot (e+f x)}{\left (\tan ^2(e+f x)+1\right ) \left (b \tan ^2(e+f x)+a\right )}d\tan ^2(e+f x)}{2 f}\) |
\(\Big \downarrow \) 93 |
\(\displaystyle \frac {\int \left (\frac {b^2}{a (a-b) \left (b \tan ^2(e+f x)+a\right )}+\frac {\cot (e+f x)}{a}-\frac {1}{(a-b) \left (\tan ^2(e+f x)+1\right )}\right )d\tan ^2(e+f x)}{2 f}\) |
\(\Big \downarrow \) 2009 |
\(\displaystyle \frac {-\frac {\log \left (\tan ^2(e+f x)+1\right )}{a-b}+\frac {b \log \left (a+b \tan ^2(e+f x)\right )}{a (a-b)}+\frac {\log \left (\tan ^2(e+f x)\right )}{a}}{2 f}\) |
(Log[Tan[e + f*x]^2]/a - Log[1 + Tan[e + f*x]^2]/(a - b) + (b*Log[a + b*Ta n[e + f*x]^2])/(a*(a - b)))/(2*f)
3.3.14.3.1 Defintions of rubi rules used
Int[((e_.) + (f_.)*(x_))^(p_)/(((a_.) + (b_.)*(x_))*((c_.) + (d_.)*(x_))), x_] :> Int[ExpandIntegrand[(e + f*x)^p/((a + b*x)*(c + d*x)), x], x] /; Fre eQ[{a, b, c, d, e, f}, x] && IntegerQ[p]
Int[(x_)^(m_.)*((a_) + (b_.)*(x_)^2)^(p_.)*((c_) + (d_.)*(x_)^2)^(q_.), x_S ymbol] :> Simp[1/2 Subst[Int[x^((m - 1)/2)*(a + b*x)^p*(c + d*x)^q, x], x , x^2], x] /; FreeQ[{a, b, c, d, p, q}, x] && NeQ[b*c - a*d, 0] && IntegerQ [(m - 1)/2]
Int[((d_.)*tan[(e_.) + (f_.)*(x_)])^(m_.)*((a_) + (b_.)*((c_.)*tan[(e_.) + (f_.)*(x_)])^(n_))^(p_.), x_Symbol] :> With[{ff = FreeFactors[Tan[e + f*x], x]}, Simp[c*(ff/f) Subst[Int[(d*ff*(x/c))^m*((a + b*(ff*x)^n)^p/(c^2 + f f^2*x^2)), x], x, c*(Tan[e + f*x]/ff)], x]] /; FreeQ[{a, b, c, d, e, f, m, n, p}, x] && (IGtQ[p, 0] || EqQ[n, 2] || EqQ[n, 4] || (IntegerQ[p] && Ratio nalQ[n]))
Time = 0.13 (sec) , antiderivative size = 58, normalized size of antiderivative = 0.91
method | result | size |
parallelrisch | \(\frac {b \ln \left (a +b \tan \left (f x +e \right )^{2}\right )-\ln \left (\sec \left (f x +e \right )^{2}\right ) a +2 \ln \left (\tan \left (f x +e \right )\right ) \left (a -b \right )}{2 a f \left (a -b \right )}\) | \(58\) |
derivativedivides | \(\frac {\frac {\ln \left (\tan \left (f x +e \right )\right )}{a}-\frac {\ln \left (1+\tan \left (f x +e \right )^{2}\right )}{2 \left (a -b \right )}+\frac {b \ln \left (a +b \tan \left (f x +e \right )^{2}\right )}{2 a \left (a -b \right )}}{f}\) | \(63\) |
default | \(\frac {\frac {\ln \left (\tan \left (f x +e \right )\right )}{a}-\frac {\ln \left (1+\tan \left (f x +e \right )^{2}\right )}{2 \left (a -b \right )}+\frac {b \ln \left (a +b \tan \left (f x +e \right )^{2}\right )}{2 a \left (a -b \right )}}{f}\) | \(63\) |
norman | \(\frac {\ln \left (\tan \left (f x +e \right )\right )}{a f}-\frac {\ln \left (1+\tan \left (f x +e \right )^{2}\right )}{2 f \left (a -b \right )}+\frac {b \ln \left (a +b \tan \left (f x +e \right )^{2}\right )}{2 a \left (a -b \right ) f}\) | \(68\) |
risch | \(\frac {i x}{a -b}-\frac {2 i x}{a}-\frac {2 i e}{a f}-\frac {2 i b x}{a \left (a -b \right )}-\frac {2 i b e}{a f \left (a -b \right )}+\frac {\ln \left ({\mathrm e}^{2 i \left (f x +e \right )}-1\right )}{a f}+\frac {b \ln \left ({\mathrm e}^{4 i \left (f x +e \right )}+\frac {2 \left (a +b \right ) {\mathrm e}^{2 i \left (f x +e \right )}}{a -b}+1\right )}{2 a f \left (a -b \right )}\) | \(131\) |
Time = 0.29 (sec) , antiderivative size = 72, normalized size of antiderivative = 1.12 \[ \int \frac {\cot (e+f x)}{a+b \tan ^2(e+f x)} \, dx=\frac {{\left (a - b\right )} \log \left (\frac {\tan \left (f x + e\right )^{2}}{\tan \left (f x + e\right )^{2} + 1}\right ) + b \log \left (\frac {b \tan \left (f x + e\right )^{2} + a}{\tan \left (f x + e\right )^{2} + 1}\right )}{2 \, {\left (a^{2} - a b\right )} f} \]
1/2*((a - b)*log(tan(f*x + e)^2/(tan(f*x + e)^2 + 1)) + b*log((b*tan(f*x + e)^2 + a)/(tan(f*x + e)^2 + 1)))/((a^2 - a*b)*f)
Leaf count of result is larger than twice the leaf count of optimal. 388 vs. \(2 (48) = 96\).
Time = 3.80 (sec) , antiderivative size = 388, normalized size of antiderivative = 6.06 \[ \int \frac {\cot (e+f x)}{a+b \tan ^2(e+f x)} \, dx=\begin {cases} \frac {\tilde {\infty } x \cot {\left (e \right )}}{\tan ^{2}{\left (e \right )}} & \text {for}\: a = 0 \wedge b = 0 \wedge f = 0 \\\frac {- \frac {\log {\left (\tan ^{2}{\left (e + f x \right )} + 1 \right )}}{2 f} + \frac {\log {\left (\tan {\left (e + f x \right )} \right )}}{f}}{a} & \text {for}\: b = 0 \\\frac {\frac {\log {\left (\tan ^{2}{\left (e + f x \right )} + 1 \right )}}{2 f} - \frac {\log {\left (\tan {\left (e + f x \right )} \right )}}{f} - \frac {1}{2 f \tan ^{2}{\left (e + f x \right )}}}{b} & \text {for}\: a = 0 \\- \frac {\log {\left (\tan ^{2}{\left (e + f x \right )} + 1 \right )} \tan ^{2}{\left (e + f x \right )}}{2 b f \tan ^{2}{\left (e + f x \right )} + 2 b f} - \frac {\log {\left (\tan ^{2}{\left (e + f x \right )} + 1 \right )}}{2 b f \tan ^{2}{\left (e + f x \right )} + 2 b f} + \frac {2 \log {\left (\tan {\left (e + f x \right )} \right )} \tan ^{2}{\left (e + f x \right )}}{2 b f \tan ^{2}{\left (e + f x \right )} + 2 b f} + \frac {2 \log {\left (\tan {\left (e + f x \right )} \right )}}{2 b f \tan ^{2}{\left (e + f x \right )} + 2 b f} + \frac {1}{2 b f \tan ^{2}{\left (e + f x \right )} + 2 b f} & \text {for}\: a = b \\\frac {x \cot {\left (e \right )}}{a + b \tan ^{2}{\left (e \right )}} & \text {for}\: f = 0 \\- \frac {a \log {\left (\tan ^{2}{\left (e + f x \right )} + 1 \right )}}{2 a^{2} f - 2 a b f} + \frac {2 a \log {\left (\tan {\left (e + f x \right )} \right )}}{2 a^{2} f - 2 a b f} + \frac {b \log {\left (- \sqrt {- \frac {a}{b}} + \tan {\left (e + f x \right )} \right )}}{2 a^{2} f - 2 a b f} + \frac {b \log {\left (\sqrt {- \frac {a}{b}} + \tan {\left (e + f x \right )} \right )}}{2 a^{2} f - 2 a b f} - \frac {2 b \log {\left (\tan {\left (e + f x \right )} \right )}}{2 a^{2} f - 2 a b f} & \text {otherwise} \end {cases} \]
Piecewise((zoo*x*cot(e)/tan(e)**2, Eq(a, 0) & Eq(b, 0) & Eq(f, 0)), ((-log (tan(e + f*x)**2 + 1)/(2*f) + log(tan(e + f*x))/f)/a, Eq(b, 0)), ((log(tan (e + f*x)**2 + 1)/(2*f) - log(tan(e + f*x))/f - 1/(2*f*tan(e + f*x)**2))/b , Eq(a, 0)), (-log(tan(e + f*x)**2 + 1)*tan(e + f*x)**2/(2*b*f*tan(e + f*x )**2 + 2*b*f) - log(tan(e + f*x)**2 + 1)/(2*b*f*tan(e + f*x)**2 + 2*b*f) + 2*log(tan(e + f*x))*tan(e + f*x)**2/(2*b*f*tan(e + f*x)**2 + 2*b*f) + 2*l og(tan(e + f*x))/(2*b*f*tan(e + f*x)**2 + 2*b*f) + 1/(2*b*f*tan(e + f*x)** 2 + 2*b*f), Eq(a, b)), (x*cot(e)/(a + b*tan(e)**2), Eq(f, 0)), (-a*log(tan (e + f*x)**2 + 1)/(2*a**2*f - 2*a*b*f) + 2*a*log(tan(e + f*x))/(2*a**2*f - 2*a*b*f) + b*log(-sqrt(-a/b) + tan(e + f*x))/(2*a**2*f - 2*a*b*f) + b*log (sqrt(-a/b) + tan(e + f*x))/(2*a**2*f - 2*a*b*f) - 2*b*log(tan(e + f*x))/( 2*a**2*f - 2*a*b*f), True))
Time = 0.24 (sec) , antiderivative size = 49, normalized size of antiderivative = 0.77 \[ \int \frac {\cot (e+f x)}{a+b \tan ^2(e+f x)} \, dx=\frac {\frac {b \log \left (-{\left (a - b\right )} \sin \left (f x + e\right )^{2} + a\right )}{a^{2} - a b} + \frac {\log \left (\sin \left (f x + e\right )^{2}\right )}{a}}{2 \, f} \]
Time = 0.56 (sec) , antiderivative size = 56, normalized size of antiderivative = 0.88 \[ \int \frac {\cot (e+f x)}{a+b \tan ^2(e+f x)} \, dx=\frac {\frac {b \log \left ({\left | -a \sin \left (f x + e\right )^{2} + b \sin \left (f x + e\right )^{2} + a \right |}\right )}{a^{2} - a b} + \frac {\log \left (\sin \left (f x + e\right )^{2}\right )}{a}}{2 \, f} \]
1/2*(b*log(abs(-a*sin(f*x + e)^2 + b*sin(f*x + e)^2 + a))/(a^2 - a*b) + lo g(sin(f*x + e)^2)/a)/f
Time = 10.90 (sec) , antiderivative size = 68, normalized size of antiderivative = 1.06 \[ \int \frac {\cot (e+f x)}{a+b \tan ^2(e+f x)} \, dx=\frac {\ln \left (\mathrm {tan}\left (e+f\,x\right )\right )}{a\,f}-\frac {\ln \left ({\mathrm {tan}\left (e+f\,x\right )}^2+1\right )}{2\,f\,\left (a-b\right )}-\frac {b\,\ln \left (b\,{\mathrm {tan}\left (e+f\,x\right )}^2+a\right )}{2\,f\,\left (a\,b-a^2\right )} \]